home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor1 / sunrset.doc < prev    next >
Text File  |  1995-03-31  |  3KB  |  58 lines

  1. (User.programs) 
  2. Item: 83 by _ckluepfel at hpcvbbs.UUCP 
  3. Author: [Charles Kluepfel] 
  4.   Subj: sunrise/sunset 
  5.   Date: Wed Jun 13 1990 21:03  
  6.  
  7. The attached file, SUNRSET, can be sent to HP-48SX to be a subdirectory to 
  8. find times of sunrise and sunset.  The same programs will work on 28C or 
  9. 28S. 
  10.  
  11. Ordinarily time of sunrise/set does not depend on the particular year, so 
  12. entry is numeric month, space or comma, numeric day, followed by SRSS.  The 
  13. year is extracted by converting the JD (days elapsed since beginning of 
  14. 4713 BC in the Julian calendar) to a Gregorian date.  The one currently 
  15. stored is 2448248, which is in 1990.  The major effect of a particular year 
  16. is in determining when daylight saving time is effective, which is taken by 
  17. this program to be the first sunday in April to the last sunday in October.  
  18. To change year, type month day year INDAT.  The set of programs presented 
  19. here is from a larger group, in which full dates are needed.  Here, we just 
  20. want to set the year, but month and day are needed for entry. 
  21.  
  22. It is necessary to customize for a location and also for the particular 
  23. meaning of sunrise/set you have in mind.  Currently the constants are set 
  24. for New York City.  The latitude is stored in LAT, here 40.75 decimal 
  25. degrees.  DL0 number of degrees west of the time zone meridian the location 
  26. is.  As New York City is 1 degree EAST of the 75th (Eastern Time) meridian, 
  27. a -1 is stored here currently.  DL1 is to get a value of 15 more than DL0 
  28. unless the location does not go on daylight saving time, in which case DL1 
  29. gets the same value as DL0. The variable DLONG gets set automatically 
  30. during calculation to one of these depending on the time of year.  
  31. Remember, that's a zero at the end of DL0, not a letter O. 
  32.  
  33. Currently ALT is set to -.75, meaning that the center of the sun is taken 
  34. to be at theoretical .75 degrees below the horizon at sunrise/set.  Due to 
  35. atmospheric refraction and the .25- degree radius of the sun, this results 
  36. in the topmost edge of the solar disk just grazing the flat horizon.  If 
  37. you want the visible disk bisected by the horizon, use -.5 instead of the 
  38. -.75. This takes care of just atmospheric refraction. 
  39.  
  40. Before the program proceeds to show the calculated sunrise and set, it 
  41. reminds you of the altitude and latitude that have been set, and the delta 
  42. longitude.  Press any, key, such as NXT, to get the calculation, showing up 
  43. as strings in levels 2 and 1. 
  44.  
  45. As a subsidiary benefit the \->JD and JD\-> functions can be used to 
  46. calculate days between dates and the date after an interval.  They require 
  47. dates that are within lists, as {6 30 1990}.  Pressing JD\-> on this, gives 
  48. 2448073, while the same function on {12 31 1989} gives 2447891, and 
  49. subtraction gives 182 as the day of the year.  As there is no input error 
  50. checking, entry of {1 0 1990} will give the same result as {12 31 1989}.  
  51. To go forward (backward) from a given date use \->JD then add (subtract) 
  52. the desired number of days; then use JD\-> to get the desired Gregorian 
  53. calendar date. 
  54.  
  55.                         -Charles Kluepfel 
  56.                          11 George St 
  57.                          Bloomfield, NJ  07003 
  58.